package datasv.login_datasv;

import po.UserPO;
import resultmessage.LoginRM;

public class UpdateUser {
	public static void main(String[] args) {
		System.out.println(new UpdateUser().updateUser(new UserPO("001131001","soft13")));
	}
	public LoginRM updateUser(UserPO po){
		return updateInSql(po);
	}
	private LoginRM updateInSql(UserPO po){
		LoginRM rm=new DeleteUser().deleteUser(po.getID());
		if(!rm.equals(LoginRM.SUCCESS)){
			return rm;
		}
		rm=new AddUser().addUser(po);
		if(!rm.equals(LoginRM.SUCCESS)){
			return rm;
		}
		return LoginRM.SUCCESS;
	}
}
